<template>
  <j-modal
    :title="title"
    :width="600"
    :visible="visible"
    :maskClosable="false"
    @close="close"
    cancelText="关闭"
  >
    <div style="margin: 0 auto" :class="{ isCheck: isCheck }">
      <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :rules="rules" :model="model">
        <a-form-model-item label="审计评价结果" prop="sjpjjg">
          <a-textarea v-model="model.sjpjjg"></a-textarea>
        </a-form-model-item>
        <a-form-model-item label="审计评价类型" prop="sjpjlx">
          <a-textarea v-model="model.sjpjlx"></a-textarea>
        </a-form-model-item>
        <a-form-model-item label="审计复核意见" prop="sjfhyj">
          <a-textarea v-model="model.sjfhyj"></a-textarea>
        </a-form-model-item>
      </a-form-model>
    </div>
    <!-- table区域-end -->
  </j-modal>
</template>
<script>
  import {httpAction, getAction} from '@/api/manage'

  export default {
    props: ['id', 'type', 'sxid'],
    components: {},
    data() {
      return {
        labelCol: {span: 6},
        wrapperCol: {span: 16},
        title: '机构信息',
        visible: false,
        isCheck: false,
        model: {},
        url: {
          save: '/sjxmzygl/sjWorkZtfaEve/updFzxj'
        },
        rules: {
          sjpjjg: [{required: true, message: '请输入'}],
          sjpjlx: [{required: true, message: '请输入'}],
          sjfhyj: [{required: true, message: '请输入'}],
        }
      }
    },
    created() {
    },
    watch: {},
    methods: {
      edit(record) {
        this.model = Object.assign({}, record)
        this.visible = true
      },
      close(isSubmit) {
        if (isSubmit) {
          this.saveData()
        } else {
          this.visible = false
        }
      },
      saveData() {
        this.$refs.form.validate((valid) => {
          if (valid) {
            httpAction(this.url.save,
              {
                proId: this.id,
                id: this.sxid,
                sjpjjg: this.model.sjpjjg,
                sjpjlx: this.model.sjpjlx,
                sjfhyj: this.model.sjfhyj
              }, 'put').then((res) => {
              if (res.success) {
                this.$message.success(res.message)
                this.$emit('ok')
                this.visible = false
              } else {
                this.$message.error(res.message);
              }
            })
          }
        })
      }
    },
  }
</script>

<style lang="less" scoped>

  .name-type {
    width: 110px;
    margin-left: 5px;
    border: 1px solid #e0e0e0;

    /deep/ .ant-select-selection {
      box-sizing: border-box;
      min-height: 27px !important;

      .ant-select-selection__rendered {
        line-height: 27px !important;
      }
    }
  }
</style>
